import React from 'react';
import { connect } from 'dva';
import { createForm } from 'rc-form';
import MemberInfo from 'components/MemberInfo';
import { ScaleHypDetailTemplate } from 'components/scaleHyp';

const NativeScaleHypPage = (props) => {
  const { dispatch, ...rest } = props;
  if (!props.location.state || props.location.state.type !== 'hyp') {
    // dispatch({ type: 'scale/reset' });
    props.location.state = { type: 'hyp', step: 0 };
  }

  return (
    <div>
      <MemberInfo {...rest.member} />
      <ScaleHypDetailTemplate {...props} member={rest.member} redirectUrl="" />
    </div>
  );
};

export default connect(({ family }) => ({ ...family }))(createForm()(NativeScaleHypPage));
